package com.project.weimi.fragment;

import java.util.ArrayList;
import java.util.List;

import com.project.weimi.R;
import com.project.weimi.adapter.InboundFragment_Adapter;
import com.project.weimi.adapter.Pendingpayment_Adapter;
import com.project.weimi.entity.response.OrderEntity;

import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.AdapterView;
import android.widget.ListView;
import android.widget.Toast;
import android.widget.AdapterView.OnItemClickListener;

public class Pendingpayment_Fragment extends BaseFragment {
	private View view;
	private ListView pendingpayment_lv;
	private List<OrderEntity> list;
	private Pendingpayment_Adapter adapter;

	@Override
	public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
		view = inflater.inflate(R.layout.activity_pendingpayment, null);
		initView();
		return view;
	}

	private void initView() {
		// TODO Auto-generated method stub
		pendingpayment_lv = (ListView) view.findViewById(R.id.pendingpayment_lv);

		list = new ArrayList<OrderEntity>();
		for (int i = 0; i < 10; i++) {
			list.add(new OrderEntity("等待买家付款", 59.81, "薄款牛仔裤男直筒宽松5分裤子男" + "\n" + "士牛仔短裤男夏季五分裤休闲中",
					"颜色:206款码;尺码:33[二尺六]", 1, 199.0, 59.81, "取消订单", "付款", R.drawable.a));

			// list.add(new OrderEntity("等待买家付款", 59.81, "薄款牛仔裤男直筒宽松5分裤子男" +
			// "\n" + "士牛仔短裤男夏季五分裤休闲中",
			// "颜色:206款码;尺码:33[二尺六]", 1, 199.0, 59.81, "取消订单", "付款",
			// R.drawable.a));
		}

		adapter = new Pendingpayment_Adapter(getActivity(), list);
		pendingpayment_lv.setAdapter(adapter);
		pendingpayment_lv.setOnItemClickListener(new OnItemClickListener() {

			@Override
			public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
				
				Toast.makeText(getActivity(), "你点击了此项", 1).show();
			}
		});
	}
}
